package com.qiuzhiyi.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;

import com.qiuzhiyi.R;

public class WelcomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_welcome);
        new Count(3*1000,1000).start();
    }
    private class Count extends CountDownTimer {

        Count(long millisInFuture, long countDownInterval) {
            super(millisInFuture, countDownInterval);

        }

        @Override
        public void onTick(long millisUntilFinished) {
        }

        @Override
        public void onFinish() {
            jump();
        }
    }

    private void jump(){
        startActivity(new Intent(this,MainActivity.class));
//        if (HumanCache.getHumanInfo(this) == null) {
//            startActivity(new Intent(this,LoginActivity.class));
//        }else {
//            startActivity(new Intent(this,MainActivity.class));
//        }
        finish();
    }
}
